import { ref, computed, watch } from 'vue'
import type { Ref } from 'vue'
import { defineStore } from 'pinia'
import Mock from 'mockjs'

interface iModcom {
  content?: string,
}

interface iModdata {
  modflog: boolean,
  index: number,
  title: string,
  imageList: {
    content: string,
  }[],
  chat: number,
  share: number,
}

export const modStore = defineStore('mod', () => {

  const title: Ref<string> = ref('')
  const imageList: Ref<iModcom[]> = ref([])
  const modflog: Ref<boolean> = ref(false)
  const index: Ref<number> = ref(0)
  const chat: Ref<number> = ref(0)
  const share: Ref<number> = ref(0)

  function changModStore(data: iModdata) {

    modflog.value = data.modflog
    title.value = data.title
    imageList.value = data.imageList
    index.value = data.index
    chat.value = data.chat
    share.value = data.share

  }

  return { title, imageList, modflog, index,chat,share, changModStore }

  
})
